const express = require('express')
const router = express.Router()

const { getOrderInfo, changeOrderStatus, deleteOrder, orderCount, searchOrder } = require('../../controller//apis/orderController')
// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middlewares/checkTokenMiddleware')

// 获取用户看房预约信息
router.get('/order', checkTokenMiddleware, getOrderInfo)

// 修改预约状态
router.patch('/order/change/:id', checkTokenMiddleware, changeOrderStatus)

// 删除预约记录
router.delete('/order/del/:id', checkTokenMiddleware, deleteOrder)

// 获取看房预约总数
router.get('/order/count', checkTokenMiddleware, orderCount)

// 搜索预约记录
router.get('/order/search', checkTokenMiddleware, searchOrder)

module.exports = router